package com.lee.demo1.dao.ext;

import java.util.List;
import java.util.Map;

import com.lee.demo1.domain.Instructons;

/**
 * 在MyBatis的Mapper class上扩展一个类用于新增的一些复杂的方法
 * @author leo
 *
 */
public interface InstructonsMapperExt{
	
	List<Instructons> selectForSearch();
	
	/**
	<select id="selectByConditionsForPading" parameterType="java.util.Map" resultMap="BaseResultMap">
	    select 
	    <include refid="Base_Column_List" />
	    from instructons 
	    <where>
		    <if test="drugNames != null">
		    and drug_names like concat('%',#{drugNames,jdbcType=VARCHAR},'%')
			</if>
		</where>
	    limit #{begin,jdbcType=INTEGER}, #{size,jdbcType=INTEGER}
  	</select>
	 */
	List<Instructons> selectByConditionsForPading(Map<String,Object> map);
	
	
	
	/**
		<select id="selectByConditionsCount" parameterType="java.util.Map" resultType="Integer">
	    select count(id) from instructons 
	    <where>
		    <if test="drugNames != null"><!--
		    and drug_names like '%#{drugNames,jdbcType=VARCHAR}%'
			-->
			and drug_names like concat('%',#{drugNames,jdbcType=VARCHAR},'%')
			</if>
		</where>
	  </select>
	 */
	int selectByConditionsCount(Map<String,Object> map);
}
